Electromagnetic structure of A=2 and 3 nuclei in chiral effective field theory