To adjust the cost, you simply divide your initial outlay by the increased number of shares. For example: if you bought 100 shares at $1 each (initial outlay of $100), and were issued 5 shares in the DRP, your cost basis per share is $100 divided by 105 = $0.9524. That's how I do it, anyway.
I think you will find that is not the correct way to do it. The shares are issued in place of the dividend.which has a value in itself. The shares are valued at that value which could be much higher than the average purchase price. The statement you get from the company issueing the shares should show a value. It is usually calculated by the company on the average selling price for a number of days prior to them being issued.