Top cocoa-producing nations Côte d'Ivoire and Ghana and major confectionery companies have agreed to take action to help eliminate deforestation.