Nonlocal potential and optical properties of solids