Spain beat Uruguay 1-0 to top Group H and reach the World Cup knockout stage, with Alex Baena's first-half strike proving decisive.