Variational theory of ion cyclotron resonance heating in tokamak plasmas