Neural-network-based approach to finite-time optimal control for a class of unknown nonlinear systems