SOFIA, May 16 (Reuters) - European Union leaders agreed on Wednesday to try to keep the Iran nuclear deal alive and maintain their reviving economic cooperation with Tehran after U.S. President Donald Trump withdrew from the pact.

But the 28 EU leaders did not make any quick decisions during their first meeting on the matter since Trump quit the accord earlier this month, highlighting how U.S. clout in international trade and finance limits the Europeans' scope for action.

That was quickly brought home by the French energy giant Total which joined other European companies in signaling on Wednesday they could exit Iran.

"As long as Iran respects the provisions of the deal, the EU will also respect it," said Donald Tusk, president of the European Council and chairman of the leaders' gathering in the Bulgarian capital Sofia.

The leaders of Britain, France and Germany briefed their peers. The three countries were EU signatories of the 2015 deal that gave Iran sanctions relief in exchange for curbing its nuclear program but which Trump dismissed as "the worst deal ever."

The head of the bloc's executive, Jean-Claude Juncker of the European Commission, has also presented options the leaders have to shield European investments in Iran and the slowly reviving economic cooperation, which many EU states hope to benefit from.

An EU source said after the talks the leaders agreed to start "work to protect European companies negatively affected by the U.S. decision."

Options include allowing the European Investment Bank to invest there and coordinating euro-denominated credit lines from EU states.

Foreign ministers of Germany, France and Britain met their Iranian counterpart in Brussels on Tuesday and tasked their experts to come up with measures for a meeting of their deputies in Vienna next week.

'IT WILL TAKE TIME'

But a senior EU official admitted there was no silver-bullet solution and that it would "take some time" for the bloc to come up with what would be a complex mix of national and joint steps.

The EU's top energy and climate official, Commissioner Miguel Arias Canete, is heading to Iran on May 18-21 for talks on energy cooperation, a symbolic gesture from the EU that it wants to stay engaged despite the U.S. withdrawal.

In his criticism of the accord, which the other signatories Russia and China also want to uphold, Trump has said it did not go far enough in restraining Iran's ability to develop nuclear weapons, while not addressing its missile program and involvement in various conflicts in the Middle East.

EU leaders agreed on Wednesday to keep on looking into these issues, but their previous efforts have not convinced Trump.

As the EU scrambles to salvage an accord they see as a key element of international security and a diplomatic success, they also wonder about their ties with Washington.

Tusk's unusually biting criticism of Trump on Wednesday highlighted the deep trans-Atlantic split: "Looking at the latest decisions of President Trump, someone could even think: With friends like that, who needs enemies?" (Reporting by Gabriela Baczynska, Editing by William Maclean and Cynthia Osterman)