Both are correct, but depend on the exact circumstance.
The first means that it HAD rained, but has since STOPPED raining. The event (rain) is completely in the past.
The second means that is HAD rained, and CONTINUES to rain now. The event (rain) happened in the past, but also continues now.
Hope this helps!