The battery can produce photons as a single photon doesn't have much of energy: around 1 eV which is 1.602*10^-19 J.
One battery has around 1.5 V and 1000 mAh, that would be 1,5 Wh or 5,4 kJ.
A single AAA battery can generate 3,37*10^22 photons with 1 eV (implying 100% efficiency).
E = mc^2 = h.
h being planck's constant,
c being the speed of light,
m being mass and E for energy.
Moving photons do have a (virtual?) mass as in they are affected by gravity and they do affect others with their own gravity, albeit very weak one.
They don't have any rest mass, which is mass at rest.