Sri Lanka President Rajapaksa agrees to resign