Donald Trump and Vladimir Putin have agreed to a prisoner swap and a 30-day "energy and infrastructure ceasefire" in Ukraine.