The influence of the interplanetary magnetic field and thermal pressure on the position and shape of the magnetopause