Entanglement dynamics of two qubits coupled by Heisenberg XY interaction under a nonuniform magnetic field in a spin bath