TLDR: you pay normal tax and 10% penalty on earnings, but not on the withdrawn nondeductible contribution itself (though if you made the contribution from income, that income is taxed)
per IRS Pub 590A chapter 1 (for 2015, not guaranteed stable in future)
Excess Contributions Withdrawn by Due Date of Return
You will not have to pay the 6% tax if you withdraw an excess contribution made during a tax year and you also withdraw any interest or other income earned on the excess contribution. You must complete your withdrawal by the date your tax return for that year is due, including extensions.
How to treat withdrawn contributions. Do not include in your gross income an excess contribution that you withdraw from your traditional IRA before your tax return is due if both of the following conditions are met.
How to treat withdrawn interest or other income. You must include in your gross income the interest or other income that was earned on the excess contribution. Report it on your return for the year in which the excess contribution was made. Your withdrawal of interest or other income may be subject to an additional 10% tax on early distributions discussed in Pub. 590-B.
This is implemented on form 5329. Instructions for Part I says
The additional tax on early distributions does not apply to any of the following: ...
- A distribution of certain excess IRA contributions (see the instructions for line 15, later, and the instructions for line 23, later).
Note. Any related IRA earnings withdrawn with excess IRA contributions are subject to the 10% additional tax on early distributions if you were under age 59½ at the time of the distribution.
and for Line 15 it says
You can withdraw some or all of your excess contributions for 2015 and they will be treated as not having been contributed if:
You make the withdrawal by the due date, including extensions, of your 2015 tax return,
You do not claim a traditional IRA deduction for the withdrawn contributions, and
You withdraw any earnings on the withdrawn contributions and include the earnings in gross income (see the Instructions for Form 8606 for details). Also, if you had not reached age 59½ at the time of the withdrawal, include the earnings as an early distribution on line 1 of Form 5329 for the year in which you report the earnings.
Line 1 then gets taxed at 10%.
Line 23 says the same thing for Roth except the bullet point about 'no deduction' is omitted because Roth is never deductible. And your question isn't about Roth anyway.