High-fidelity gates and creation of entangled states in Yb171 nuclear-spin qubits