We review the role that magnetic field may have on the formation and evolution of molecular clouds. After a brief presentation and main assumptions leading to ideal MHD equations, their most important correction, namely the ion-neutral drift is described. The nature of the multi-phase interstellar medium (ISM) and the thermal processes that allows this gas to become denser are presented. Then we discuss our current knowledge of compressible magnetized turbulence, thought to play a fundamental role in the ISM. We also describe what is known regarding the correlation between the magnetic and the density fields. Then the influence that magnetic field may have on the interstellar filaments and the molecular clouds is discussed, notably the role it may have on the prestellar dense cores as well as regarding the formation of stellar clusters. Finally we briefly review its possible effects on the formation of molecular clouds themselves. We argue that given the magnetic intensities that have been measured, it is likely that magnetic field is i) responsible of reducing the star formation rate in dense molecular cloud gas by a factor of a few, ii) strongly shaping the interstellar gas by generating a lot of filaments and reducing the numbers of clumps, cores and stars, although its exact influence remains to be better understood. Moreover at small scales, magnetic braking is likely a dominant process that strongly modifies the outcome of the star formation process. Finally, we stress that by inducing the formation of more massive stars, magnetic field could possibly enhance the impact of stellar feedback.