Nanostructural and optical properties of cobalt and nickel-oxide/silica nanocomposites