After several hours of face-to-face wrangling, EU leaders have agreed to ban most Russian oil from the bloc's market by the end of the year.