An analysis of optical echelle spectra towards nine stars in the Cep OB4 association is presented. Interstellar absorption lines which arise in the (1, 0) and (2, 0) bands of the CN A 2Π - X 2Σ+ red system towards BD+66° 1661, BD+66° 1674, and BD+66° 1675 are used to infer accurate CN column densities N(CN). A comparison with earlier measurements in the CN violet system allows to infer a CN Doppler b parameter of b(CN)=1.2-2.4km/s. Molecular carbon absorption lines which arise in the (1, 0), (2, 0) and (3, 0) bands of the C2A1Πu-X1Σg+ Phillips system is used to infer gaskinetic temperatures of 35±10K and densities of n=700±200cm–3 towards BD+66° 1661 and BD+66° 1675, and a temperature of 60±10K and a density of 800±400cm–3 towards BD+66° 1674. The R(1) line of the (0, 0) band of the CHA2Δ-X2Π system is detected towards 6 stars. A tight correlation exists between N(C2) and N(CH). N(CN) increases with N(CH) and with N(C2). Interstellar CH+ is marginally detected towards four stars. Inferred CH+ column densities are significantly lower than towards other lines of sight with similar reddening. The velocity structure towards Cep OB4 and the chemical abundances suggest that CN, C2, CH, and CH+ are formed in quiescent material. A previous suggestion that the molecules form in a photon-dominated region close to the stars is not supported by the observations.