  This paper is a continuation of "Quantization of Lie bialgebras, III"
(q-alg/9610030, revised version). In QLB-III, we introduced the Hopf algebra
F(R)_\z associated to a quantum R-matrix R(z) with a spectral parameter, and a
set of points \z=(z_1,...,z_n). This algebra is generated by entries of a
matrix power series T_i(u), i=1,...,n,subject to Faddeev-Reshetikhin-Takhtajan
type commutation relations, and is a quantization of the group GL_N[[t]].
  In this paper we consider the quotient F_0(R)_\z of F(R)_\z by the relations
\qdet_R(T_i)=1, where \qdet_R is the quantum determinant associated to R (for
rational, trigonometric, or elliptic R-matrices). This is also a Hopf algebra,
which is a quantization of the group SL_N[[t]].
  This paper was inspired by the pioneering paper of I.Frenkel and Reshetikhin.
The main goal of this paper is to study the representation theory of the
algebra F_0(R)_\z and of its quantum double, and show how the consideration of
coinvariants of this double (quantum conformal blocks) naturally leads to the
quantum Knizhnik-Zamolodchikov equations of Frenkel and Reshetikhin.
  Our construction for the rational R-matrix is a quantum analogue of the
standard derivation of the Knizhnik-Zamolodchikov equations in the
Wess-Zumino-Witten model of conformal field theory, and for the elliptic
R-matrix is a quantum analogue of the construction of Kuroki and Takebe.
  Our result is a generalization of the construction of Enriques and Felder,
which appeared while this paper was in preparation. Enriques and Felder gave a
derivation of the quantum KZ equations from coinvariants in the case of the
rational R-matrix and N=2.
