An artificial spiking synapse made of molecules and nanoparticles