A four-parameter class of exact asymptotically flat solutions of the Einstein-Maxwell equations involving only rational functions is presented. It is able to describe the exterior field of a slowly or rapidly rotating neutron star with poloidal magnetic field.