If you mapped the reads to the masked sequence, then I would use the masked length to calculate the RPKM.
The rationale is that you are effectively removing reads that would have mapped to that masked region, so you should also remove the length of the masked region when normalizing by length.