Magnetoelectric effect and low-temperature phase transitions of TbMn2O5