LONDON—Energy giant BP PLC has agreed to sell its petrochemicals business to a British chemicals company for $5 billion, marking the largest deal by an oil major since the coronavirus outbreak gripped the global economy. The sale to Ineos Ltd. could help BP pare its relatively high debt load and separates the company from its peers. Royal Dutch Shell PLC and Exxon Mobil Corp. have been expanding their petrochemicals businesses partly because they have a brighter demand outlook than other areas such as transportation fuels. …