Dust extinction and molecular gas in the dark cloud IC 5146