Variationally optimized numerical orbitals for molecular calculations