Modelling magnetized neutron stars using resistive magnetohydrodynamics