US president expressed frustration with Russian and Ukrainian leaders as he struggles to forge a truce to end war.