Landau levels in QCD in an external magnetic field