Thermal strain and magnetization of the ferromagnetic shape memory alloy Ni52Mn25Ga23 in a magnetic field