Magnetic fields are believed to play a crucial role in the process of star formation. We compare high-angular resolution observations of the submillimeter polarized emission of NGC 1333 IRAS 4A, tracing the magnetic field around a low-mass protostar, with models of the collapse of magnetized molecular cloud cores. Assuming a uniform dust alignment efficiency, we computed the Stokes parameters and synthetic polarization maps from the model density and magnetic field distribution by integrations along the line-of-sight and convolution with the interferometric response. The synthetic maps are in good agreement with the data. The best-fitting models were obtained for a protostellar mass of 0.8M☉, of age 9x104yr, formed in a cloud with an initial mass-to-flux ratio ∼2 times the critical value. The magnetic field morphology in NGC 1333 IRAS 4A is consistent with the standard theoretical scenario for the formation of solar-type stars, where well-ordered, large-scale, rather than turbulent, magnetic fields control the evolution and collapse of the molecular cloud cores from which stars form.