Thermal quantum discord of spins in an inhomogeneous magnetic field