An earthquake hit an area in western Iran near the Iraqi border on Sunday, injuring about 31 people, most of them lightly, the state news agency IRNA reported.