Nonlinear variational formulation for a cavitation problem in lubrication