Ukraine and Russia have agreed to a tentative ceasefire involving the Black Sea and strikes on energy infrastructure.