Excited state localization in organic molecules consisting of conjugated and nonconjugated segments