A preliminary 3.0 magnitude earthquake struck near Clayton in Contra Costa County late Tuesday night, according to the United States Geological Survey.