Purdue Pharma LP has agreed to settle a lawsuit by the state of Oklahoma accusing the OxyContin painkiller maker of helping fuel an opioid abuse epidemic, a person familiar with the matter said.