  The production of a primordial stochastic gravitational-wave background by
processes occuring in the early Universe is expected in a broad range of
models. Observing this background would open a unique window onto the
Universe's evolutionary history. Probes like the Cosmic Microwave Background
(CMB) or the Baryon Acoustic Oscillations (BAO) can be used to set upper limits
on the stochastic gravitational-wave background energy density $\Omega_{GW}$
for frequencies above $10^{-15}$ Hz. We perform a profile likelihood analysis
of the Planck CMB temperature anisotropies and gravitational lensing data
combined with WMAP low-$\ell$ polarization, BAO, South Pole Telescope and
Atacama Cosmology Telescope data. We find that $\Omega_{GW}h_{0}^{2} < 3.8
\times 10^{-6}$ at 95\% confidence level for adiabatic initial conditions which
improves over the previous limit by a factor 2.3. Assuming that the primordial
gravitational waves have been produced by a network of cosmic strings, we have
derived exclusion limits in the cosmic string parameter space. If the size of
the loops is determined by gravitational back-reaction, string tension values
greater than $\sim 4 \times 10^{-9}$ are excluded for a reconnection
probability of $10^{-3}$.
