It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) - probably as a saying of the Prophet: "When the sun sets, keep your children in, for it is the hour in which the devils spread out."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11048