OPEC and Russia have agreed to extend oil output cuts until the end of 2018 following hours of discussions in Vienna.