Modeling projection effects in optically-selected cluster catalogues