President of Ukraine Viktor Yanukovych and opposition leaders have agreed to a truce after violence that left at least 26 dead, the president’s office says.