Liverpool have confirmed that captain Steven Gerrard has signed an extension to his contract which will keep him at Anfield for the next two seasons at least.