Ukraine, Russia and the EU have struck a monitoring agreement enabling the resumption of Russian gas supplies to Europe.