Process for extracting metals present in hydrocarbon fractions