Measurements of the branching fraction and time-dependent CP asymmetries of B0→J/ψπ0 decays