Optical properties of titanium-doped lithium niobate from time-dependent density-functional theory