Uniform magnetic field (due to horse shoe magnet)
Magnetic field due to current carrying straight wire
Net field formed due to the above two fields
Explanation :
The net field in upper part is strong and in lower part it is weak. Hence a nonuniform field is created around wire. Therefore the wire tries to move to the weaker field region.