A fully geometrical treatment of general relativistic magnetohydrodynamics (GRMHD) is developed under the hypotheses of perfect conductivity, stationarity and axisymmetry. The spacetime is not assumed to be circular, which allows for greater generality than the Kerr-type spacetimes usually considered in GRMHD. Expressing the electromagnetic field tensor solely in terms of three scalar fields related to the spacetime symmetries, we generalize previously obtained results in various directions. In particular, we present the first relativistic version of the Soloviev transfield equation, subcases of which lead to fully covariant versions of the Grad-Shafranov equation and of the Stokes equation in the hydrodynamical limit. We have also derived, as another subcase of the relativistic Soloviev equation, the equation governing magnetohydrodynamical equilibria with purely toroidal magnetic fields in stationary and axisymmetric spacetimes.