The electromagnetic field in a magnetized neutron star and the underlying volume charges and currents are found. A general case of a rigidly rotating neutron star with infinite conductivity, arbitrary distribution of the internal magnetic field, arbitrarily changing angular velocity, and arbitrary surface velocity less than the velocity of light is considered. Quaternions are used to describe rotation and determine the magnetic field. It is shown that the charge density is not equal to and can exceed significantly the common Goldreich-Julian density. Moreover, corrections to the magnetic field due to stellar rotation are zero. For a rotating neutron star, twisting magnetic field lines causes charge accumulation and current flows. This fact shows a possible link between changing internal magnetic field topology and observed activity of neutron stars.