  Primordial magnetic fields (PMF) damp at scales smaller than the photon
diffusion and free-streaming scale. This leads to heating of ordinary matter
(electrons and baryons), which affects both the thermal and ionization history
of our Universe. Here, we study the effect of heating due to ambipolar
diffusion and decaying magnetic turbulence. We find that changes to the
ionization history computed with recfast are significantly overestimated when
compared with CosmoRec. The main physical reason for the difference is that the
photoionization coefficient has to be evaluated using the radiation temperature
rather than the matter temperature. A good agreement with CosmoRec is found
after changing this aspect. Using Planck 2013 data and considering only the
effect of PMF-induced heating, we find an upper limit on the r.m.s. magnetic
field amplitude of B0 < 1.1 nG (95% c.l.) for a stochastic background of PMF
with a nearly scale-invariant power spectrum. We also discuss uncertainties
related to the approximations for the heating rates and differences with
respect to previous studies. Our results are important for the derivation of
constraints on the PMF power spectrum obtained from measurements of the cosmic
microwave background anisotropies with full-mission Planck data. They may also
change some of the calculations of PMF-induced effects on the primordial
chemistry and 21cm signals.
