A new sequential quadratic Hamiltonian method for computing optimal relaxed controls for a class of optimal control problems governed by ordinary differential equations is presented. This iterative approach is based on the characterisation of optimal controls by means of the Pontryagin maximum principle in the framework of Young measures, and it belongs to the family of successive approximations schemes. The ability of the proposed optimisation framework to solve problems with regular and relaxed controls, including cases with oscillations and concentration effects, is demonstrated by results of numerical experiments. In all cases, the sequential quadratic Hamiltonian scheme appears robust and efficient, in agreement with convergence results of the theoretical investigation presented in this paper.