Ag–SiO2 nanocomposite for the optical detection of Hg(II) ions and catalytic reduction of methylene blue