Methods are provided for extracting heterocyclic compounds, organometallic compounds, and polynuclear aromatic hydrocarbons from a hydrocarbon feedstock such as crude oil or a crude fraction. The heterocyclic compounds and organometallic compounds are removed from the hydrocarbon feedstock through one or more successive extractions to form a first raffinate. The extractions use a first solvent system containing an ionic liquid formed from carbon dioxide and water. The polynuclear aromatic hydrocarbons are removed from the first raffinate using a second solvent system containing an aprotic solvent such as NMP, DMSO, aromatics, or combinations thereof. The extracted compounds remain chemically intact and may be fractionated for further applications. Further methods are provided for producing a hydrocarbon raffinate having reduced levels of heterocyclic compounds, organometallic compounds, and 2-4 cycle polynuclear aromatic hydrocarbons.