I was going to ask which year the contribution is to be applied to. My understanding is that you have until March 15th (tax return due date for biz) to make contributions for the previous year.
If you do accrual-basis accounting, as all my clients do, you would accrue this expense in 2018, even if you did not make payment until 2019, which is when the cash would be paid for liability.
I will assume you are doing cash-basis accounting, so then your accounting transaction occurs when cash changes hands, so on the date you make actual payment is when you record entry.
I am not a tax accountant, so I do not give tax advice, so some others may chime in here, but I am an S Corp owner and contribute to my SEP IRA annually, same as most of my clients.
I made contributions in current year and in Q1 for prior years and made the same entry on my books as described. Tax returns reflect what year your contributions would be applied to.