Context. In spite of decades of theoretical efforts, the physical origin of the stellar initial mass function (IMF) is still debated. Aims. We aim at understanding the influence of various physical processes such as radiative stellar feedback, magnetic field and non-ideal magneto-hydrodynamics on the IMF. Methods. We present a series of numerical simulations of collapsing 1000 M clumps taking into account radiative feedback and magnetic field with spatial resolution down to 1 AU. Both ideal and non-ideal MHD runs are performed and various radiative feedback efficiencies are considered. We also develop analytical models that we confront to the numerical results.Results. The sum of the luminosities produced by the stars in the calculations is computed and it compares well with the bolometric luminosities reported in observations of massive star forming clumps. The temperatures, velocities and densities are also found to be in good agreement with recent observations. The stellar mass spectrum inferred for the simulations is, generally speaking, not strictly universal and in particular varies with magnetic intensity. It is also influenced by the choice of the radiative feedback efficiency. In all simulations, a sharp drop in the stellar distribution is found at about M min 0.1 M , which is likely a consequence of the adiabatic behaviour induced by dust opacities at high densities. As a consequence, when the combination of magnetic and thermal support is not too large, the mass distribution presents a peak located at 0.3-0.5 M . When magnetic and thermal support are large, the mass distribution is better described by a plateau, i.e. dN/d log M ∝ M −Γ , Γ 0. At higher masses the mass distributions drop following power-law behaviours until a maximum mass M max whose value increases with field intensity and radiative feedback efficiency. Between M min and M max the distributions inferred from the simulations agree well with an analytical model inferred from gravoturbulent theory. Due to the density PDF ∝ ρ −3/2 relevant for collapsing clouds, values on the order of Γ 3/4 are inferred both analytically and numerically. More precisely, after 150 M of gas have been accreted, the most massive star has a mass of about 8 M when magnetic field is significant, and 3 M only when both radiative feedback efficiency and magnetic field are low, respectively. Conclusions. When both magnetic field and radiative feedback are taken into account, they are found to have a significant influence on the stellar mass spectrum. In particular both reduce fragmentation and lead to the formation of more massive stars.