Formation of magnetite by bacteria and its application