Synthesis and characterization of silver nanoparticles and their application as an antibacterial agent