Brexit served as a "vaccine" against the eurosceptic vote in the EU parliamentary elections, European Council president has said.