The Portuguese air force rescued 34 migrants from the sea after a boat carrying them burst into flames off the Spanish coast.