Oil producing nations agree a deal that will see output reduced by nearly 10 million barrels a day.