Modeling of the magnetosphere of Mercury at the time of the first MESSENGER flyby