The paper deal with the problem of manipulation of two-level quantum systems using the approach of optimal control. The considered problem is the steering of the state of the quantum system to a desired final configuration at a prescribed time by minimizing a cost which is quadratic in the control, which represents energy. In fact the problem of driving the evolution operator of the quantum system to a prescribed final configuration is treated. This problem translates into an optimal control problem for systems varying on the Lie group of special unitary matrices of dimension two, with cost that is quadratic in the control. For all the possible situations, in particular number of controls and parameters involved in the equations of the system we derive the form of the optimal controls. The mathematical results include proofs of the `normality' of the problem at hand as well as a proof of the regularity of the optimal control functions. As an application, we prove that the resonance frequency sinusoidal fields used in Nuclear Magnetic Resonance experiments with spin 1/2 particles are the minimum energy fields.