Ukraine has agreed to accept an immediate 30-day ceasefire in the conflict with Russia during talks with US officials in Saudi Arabia, officials say.