Ferrari's Charles Leclerc became the first retirement at the Spanish Grand Prix due to an issue with his engine.