The US president has been trying to get both sides to agree to a ceasefire in the three-year-old war in Ukraine.