Characterization of structural and photoinduced defects in pure and doped lithium niobate