Continuous finite element methods which preserve energy properties for nonlinear problems