Quantum dynamics of nuclear spins and spin relaxation in organic semiconductors