Exact optical self-similar solutions in a tapered graded-index nonlinear-fiber amplifier with an external source