US President Donald Trump says Russia and Ukraine have agreed to refrain from attacking each other's energy infrastructure.