Nanometre-scale nuclear-spin device for quantum information processing