Ab initio study of the structural, electronic, magnetic, and optical properties of silicene nanoribbons