Russia and Ukraine have agreed to a maritime ceasefire to secure shipping in the Black Sea, the White House says.