Flat-spectrum radio sources with faint optical counterparts