Optimal sliding mode control for nonlinear systems with time-delay