Turkey’s main opposition party retained its control over key cities and made huge gains elsewhere in Sunday’s local elections, in a major upset to President Recep Tayyip Erdogan, who had set his sights on retaking control of those urban areas. Erdogan acknowledged the electoral setback in a speech delivered from the balcony of the presidential palace, saying his party had suffered “a loss of altitude” across Turkey.