Liverpool returned to the top of the Premier League in controversial circumstances after a dramatic 2-1 victory over West Ham at Upton Park.