Former Barcelona forward Bojan Krkic has announced his immediate retirement from football at the age of 32.