A company that helped develop marketing campaigns for OxyContin and other opioids has agreed to a $350 million settlement.