(Recasts with decision, Kern quote)
By Gabriela Baczynska
BRUSSELS, June 22 (Reuters) - European Union leaders will decide this autumn where to move EU banking and medicines agencies that they are pulling out of London due to Brexit, using a voting system some liken to the Eurovision song contest.
Most of the remaining 27 EU states have expressed interest in hosting the European Banking Authority (EBA) and the European Medicines Agency (EMA), which together employ more than 1,000 people.
They are keen not to let the historically divisive issue of hosting agencies break their unity over Brexit, although several officials joked about how the choice will be made after leaders agreed at a summit on Thursday it was the best way to stop rows.
"It is going to be an exciting race. We know how this works from Eurovision," Austrian Chancellor Christian Kern joked, recalling his country's recent triumph in the kitsch pan-European music festival, won in 2014 by a bearded drag queen from Vienna.
Governments have been arguing over how to choose new host cities, which can expect to profit from the move.
Under the agreed procedure, countries will have until the end of July to submit candidate cities. These will then be assessed by the executive European Commission by September.
Using those assessments, EU leaders will try to reach a consensus deal at their next summit in Brussels in October. In any event, ministers will then hold a vote the following month, giving states a number of votes to apportion to their favourites and proceeding through knockout rounds to a winner.
Earlier on Thursday, France and Germany dismissed a report by German magazine WirtschaftsWoche that the two biggest EU countries had agreed to divide the agencies between themselves, with the EBA going to Frankfurt and EMA to Lille.
Barcelona, Milan, Copenhagen and Dublin are among the states campaigning for EMA, which has an annual budget of $360 million.
Frankfurt, Paris, Amsterdam, Vienna, Lyon and Strasbourg are among the cities vying to host the EBA, whose 160 employees write and coordinate banking rules across the bloc.
Among criteria for selection are the city's infrastructure, transport links, jobs for employees' families and ensuring that EU institutions are spread around Europe. Newer, Eastern members say they do not have enough EU bodies and want this changed. (Reporting by Maria Sheahan in Frankfurt, Andreas Rinke in Berlin, Michel Rose in Paris, Gabriela Baczynska, Peter Maushagen and Tom Koerkemeier in Brussels; Editing by Alastair Macdonald and Bill Trott)