We study the photo-induced alignment of a nematic liquid crystal in contact with an azo-dye-doped polyimide alignment layer. Using polarized light to illuminate a planar nematic cell with one active alignment layer results in the formation of twisted nematic domains. We measured the dynamics of domain growth resulting from light-induced changes in the surface anchoring. We interpret the results in terms of a simple model for the evalution of the orientational distribution function of the dye and the resulting anchoring potential. We discuss possible applications of optical alignment.