Weyl nodes with higher-order topology in an optically driven nodal-line semimetal