Nonhomogeneous telegraph processes and their application to financial market modeling