  We prove the nontrivial variant \[
\sum\limits_{m,n=1}^{\infty}\Big(\frac{n}{m}\Big)^{\frac{1}{q}-\frac{1}{p}}\frac{a_mb_n}{m+n-1}\leq\frac{\pi}{\sin\frac{\pi}{p}}
\Big( \sum\limits_{m=1}^{\infty}a_m^p\Big)^{\frac 1p}\Big(
\sum\limits_{n=1}^{\infty}b_n^q\Big)^{\frac 1q} \] of the well known Hilbert's
inequality. Then we use this to determine the exact value
$\frac{\pi}{\sin\frac{\pi}p}$ of the norm of the Hilbert matrix as an operator
acting on the Hardy-Littlewood space $K^p$. This space consists of all
functions $f(z)=\sum\limits_{m=0}^{\infty}a_mz^m$ analytic in the unit disc
with $\|f\|_{K^p}^p=\sum\limits_{m=0}^{\infty}(m+1)^{p-2}|a_m|^p<+\infty$.
