Deuteron quadrupole-perturbed NMR is used to study the perturbation of orientational order in a smectic-A liquid crystal (octylcyanobiphenyl or 8CB) caused by photoinduced trans-to-cis isomerization of a photosensitive dopant (diheptylazobenzene or 7AB). The time and temperature dependences of the orientational order were independently studied for 8CB, 7AB, and their mixtures. Upon UV irradiation that causes trans-to-cis isomerization of 7AB, the orientational order parameter of the smectic-A phase is reduced. Relaxation in the dark exponentially restores the equilibrium value of the order parameter. The characteristic time for this process closely matches the lifetimes of the 7AB excited state. While in the 8CB smectic-A matrix, the cis-isomerized 7AB molecules retain a uniaxial orientational order with the director oriented along the normal to the smectic layers. The highly bent 7AB cis molecules act as a disorienting factor, decreasing the orientational order in the layers and causing a small increase in layer spacing. This disorder-induced increase in layer spacing is much smaller than the actual increase as observed by in situ x-ray experiments on UV-irradiated mixtures of 8CB:7AB. Concomitant with the experimental observation that only a fraction of 7AB molecules are converted to the cis state, this work provides indirect evidence for a nanophase segregation with the 7AB cis-isomers arranged within the interlayer space, thus significantly increasing the smectic layer spacing.