The nitrogen-vacancy (NV) color center in diamond is an atom-like system in the solid-state which specific spin properties can be efficiently used as a sensitive magnetic sensor. An external magnetic field induces Zeeman shifts of the NV center levels which can be measured using Optically Detected Magnetic Resonance (ODMR). In this work, we exploit the ODMR signal of an ensemble of NV centers in order to quantitatively map the vectorial structure of a magnetic field produced by a sample close to the surface of a CVD diamond hosting a thin layer of NV centers. The reconstruction of the magnetic field is based on a maximum-likelihood technique which exploits the response of the four intrinsic orientations of the NV center inside the diamond lattice. The sensitivity associated to a 1 {mu}m^2 area of the doped layer, equivalent to a sensor consisting of approximately 10^4 NV centers, is of the order of 2 {mu}T/sqrt{Hz}. The spatial resolution of the imaging device is 400 nm, limited by the numerical aperture of the optical microscope which is used to collect the photoluminescence of the NV layer. The versatility of the sensor is illustrated by the accurate reconstruction of the magnetic field created by a DC current inside a copper wire deposited on the diamond sample.