An earthquake of magnitude 6.2 struck on Tuesday on New Zealand’s north island, the United States Geological Survey said.