Confinement and the safety factor profile