Anthem Inc. struck a deal to buy rival Cigna Corp. for $48.4 billion, wrapping up almost a year of contentious negotiations and potentially creating the largest health insurer in the U.S.