We present deep observations at 450 um and 850 um in the Extended Groth Strip field taken with the SCUBA-2 camera mounted on the James Clerk Maxwell Telescope as part of the deep SCUBA-2 Cosmology Legacy Survey (S2CLS), achieving a central instrumental depth of $sigma_{450}=1.2$ mJy/beam and $sigma_{850}=0.2$ mJy/beam. We detect 57 sources at 450 um and 90 at 850 um with S/N > 3.5 over ~70 sq. arcmin. From these detections we derive the number counts at flux densities $S_{450}>4.0$ mJy and $S_{850}>0.9$ mJy, which represent the deepest number counts at these wavelengths derived using directly extracted sources from only blank-field observations with a single-dish telescope. Our measurements smoothly connect the gap between previous shallower blank-field single-dish observations and deep interferometric ALMA results. We estimate the contribution of our SCUBA-2 detected galaxies to the cosmic infrared background (CIB), as well as the contribution of 24 um-selected galaxies through a stacking technique, which add a total of $0.26pm0.03$ and $0.07pm0.01$ MJy/sr, at 450 um and 850 um, respectively. These surface brightnesses correspond to $60pm20$ and $50pm20$ per cent of the total CIB measurements, where the errors are dominated by those of the total CIB. Using the photometric redshifts of the 24 um-selected sample and the redshift distributions of the submillimetre galaxies, we find that the redshift distribution of the recovered CIB is different at each wavelength, with a peak at $zsim1$ for 450 um and at $zsim2$ for 850um, consistent with previous observations and theoretical models.