This work presents a new physical model of the star formation rate (SFR), which is verified with an unprecedented set of large numerical simulations of driven, supersonic, self-gravitating, magneto-hydrodynamic (MHD) turbulence, where collapsing cores are captured with accreting sink particles. The model depends on the relative importance of gravitational, turbulent, magnetic, and thermal energies, expressed through the virial parameter, alpha(vir), the rms sonic Mach number, M-s,M-0, and the ratio of mean gas pressure to mean magnetic pressure, beta(0). The SFR is predicted to decrease with increasing alpha(vir) (stronger turbulence relative to gravity), to increase with increasing, M-s,M-0 (for constant values of alpha(vir)), and to depend weakly on beta(0) for values typical of star forming regions (M-s,M-0 approximate to 4-20 and beta(0) approximate to 1-20). In the unrealistic limit of beta(0) -> infinity, that is, in the complete absence of a magnetic field, the SFR increases approximately by a factor of three, which shows the importance of magnetic fields in the star formation process, even when they are relatively weak (super-Alfvenic turbulence). The star-formation simulations used to test the model result in an approximately constant SFR, after an initial transient phase. The dependence of the SFR on the virial parameter is shown to agree very well with the theoretical predictions.