Erling Haaland's stoppage time penalty gave Manchester City a dramatic and chaotic 2-1 win at Anfield.