Spain beats France to revive World Cup campaign