European Commission President Ursula von der Leyen and Chilean President Gabriel Boric have agreed a deal on lithium to make electric vehicle batteries.