The deformation of an interface between two fluids in a porous medium