Messi, who has been criticized after indifferent recent form, set up Keita for the opener as the Mali international dived to head home the Argentine's clever cross from a well-worked short corner in the 25th minute.
Gutierrez's initial cross was blocked by Kolo Toure but the Argentine winger collected the loose ball in the box and blasted a powerful rising shot past Hart from 10 yards.
The Argentine had already hit the post from Aleksandar Kolarov's cross when he slotted home from the spot after Steven Reid hauled Kolarov down in the box.