A magnitude 5.4 earthquake hit southeast Iran on Wednesday evening, state media said.