On the variational approach to axisymmetric magnetohydrodynamic equilibria