  We prove that the algebra $\cal{A}$ of chord diagrams, the dual to the
associated graded algebra of Vassiliev knot invariants, is isomorphic to the
universal enveloping algebra of a Casimir Lie algebra in a certain tensor
category (the PROP for Casimir Lie algebras). This puts on a firm ground a
known statement that the algebra $\cal{A}$ ``looks and behaves like a universal
enveloping algebra''. An immediate corollary of our result is the conjecture of
Bar-Natan, Garoufalidis, Rozansky, and Thurston on the Kirillov-Duflo
isomorphism for algebras of chord diagrams.
  Our main tool is a general construction of a functor from the category
$\mathtt{CycOp}$ of cyclic operads to the category $\mathtt{ModOp}$ of modular
operads which is left adjoint to the ``tree part'' functor $\mathtt{ModOp} \to
\mathtt{CycOp}$. The algebra of chord diagrams arises when this construction is
applied to the operad for Lie algebras. Another example of this construction is
Kontsevich's graph complex that corresponds to the operad for homotopy Lie
algebras.
