  Millisecond pulsars are extremely precise celestial clocks: as they rotate,
the beamed radio waves emitted along the axis of their magnetic field can be
detected with radio telescopes, which allows for tracking subtle changes in the
pulsars' rotation periods. A possible effect on the period of a pulsar is given
by a potential coupling to dark matter, in cases where it is modeled with an
"ultralight" scalar field. In this paper, we consider a universal conformal
coupling of the dark matter scalar to gravity, which in turn mediates an
effective coupling between pulsars and dark matter. If the dark matter scalar
field is changing in time, as expected in the Milky Way, this effective
coupling produces a periodic modulation of the pulsar rotational frequency. By
studying the time series of observed radio pulses collected by the European
Pulsar Timing Array experiment, we present constraints on the coupling of dark
matter, improving on existing bounds. These bounds can also be regarded as
constraints on the parameters of scalar-tensor theories of the
Fierz-Jordan-Brans-Dicke and Damour-Esposito-Far\`{e}se types in the presence
of a (light) mass potential term.
