Magnitude 5.1 earthquake shakes western Iran