A father has been banned from contacting his former partner after he slapped her around the face during an argument over changing a nappy.