The country’s top officials were trying to determine the cause of an outage that left tens of millions of people across the Iberian Peninsula without power.