A retarded integral inequality and its applications