OPEC has reached a deal to curtail oil production for the first time since 2008.