Simultaneous observation of nuclear and electronic dynamics by ultrafast electron diffraction